package database;
import java.sql.*;

public class DBconn {
	public static Connection con;
	public static Connection getConnection() {
		String url = "jdbc:mysql://localhost/";
		String dbName = "messaging";
		String driver = "com.mysql.jdbc.Driver";
		String userName = "root"; 
		String password = "";
		try {
			  Class.forName(driver).newInstance();
			  con = DriverManager.getConnection(url+dbName,userName,password);	  
		  } catch (Exception e) {
			  e.printStackTrace();
		  }
		return con;
	}
}
